package com.csun.cmny.provider.dao;

import com.csun.cmny.provider.dto.OmcOldLeaveQueryDto;
import com.csun.cmny.provider.model.dto.old_leave.OldLeaveOldmanQueryDto;
import com.csun.cmny.provider.model.vo.old_leave.OldLeaveOldmanVo;
import com.csun.cmny.provider.pojo.OmcOldLeave;
import com.csun.cmny.provider.vo.OldLeaveVo;
import com.csun.cmny.provider.vo.OldUnLeaveVo;
import com.csun.cmny.provider.vo.OmcAdjustRefundData;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface OmcOldLeaveMapper extends Mapper<OmcOldLeave> {

    //根据ID查询请假记录
    OldLeaveVo showById(@Param("id") Long id);

    //根据老人ID和老人姓名查询所有的请假记录
    List<OldLeaveVo> showAll(OmcOldLeaveQueryDto omcOldLeaveQueryDto);


    //根据老人姓名查询该班组老人信息
    List<OldUnLeaveVo> selectOldManByName(OmcOldLeaveQueryDto omcOldLeaveQueryDto);

    /**
     * 根据老人ID,机构和时间段查询老人请假信息
     * @param paramMap
     * @return
     */
    List<OmcOldLeave> selectOldLeaveList(Map<String,Object> paramMap);

    /**
     * 查看老人是否在请假中
     * @param omcOldLeave
     * @return
     */
    int confirmLeave(OmcOldLeave omcOldLeave);

    /**
     * 调房调级--查询老人上个周期账单执行时间至调房调级的时间间的未退费的请假和退费金额
     * @param omcOldLeaveQueryDto
     * @return
     */
    OmcAdjustRefundData showLeaveRefundFee(OmcOldLeaveQueryDto omcOldLeaveQueryDto);

    /**
     * 查询可以进行请假的老人
     *
     * @param oldLeaveOldmanQueryDto the old leave oldman query dto
     *
     * @return the old leave oldman vo
     */
    List<OldLeaveOldmanVo> queryOldmanList(OldLeaveOldmanQueryDto oldLeaveOldmanQueryDto);

    /**
     * 查询请假日期在请假日期和回院日期之间的记录数量
     *
     * @param leaveDate the leave date
     *
     * @return the int
     */
    int queryCountByLeaveDate(@Param("oldmanId") Long oldmanId,
                              @Param("leaveDate") String leaveDate);

    /**
     * close oldman leave return fee by oldman id and date
     *
     * @param oldmanId
     * @param date
     *
     * @return
     */
    int closeReturnFeeByDate(@Param("oldmanId") Integer oldmanId, @Param("date") String date);

    /**
     * 查询今天请假老人的请假详情
     * @param groupId
     * @return
     */
    List<OldLeaveOldmanVo> selectLeaveOldMan(Long groupId);
}